home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
LIFE_SIM
/
VERSION_
/
HANDLEMO.C
< prev
next >
Wrap
Text File
|
1992-03-12
|
2KB
|
111 lines
/* Cell Proj 1.0 */
#include "MacProto.h"
#include "Cell_Proto.h"
#include "Cell_Definitions.h"
#include "Cell_Variables.h"
HandleMouseDown()
{
WindowPtr whichWindow;
short thePart;
int theControlPart;
long int menuChoice, windSize;
ControlHandle controlHitHandle;
int hitControl, oldValue, currentValue;
thePart = FindWindow( gTheEvent.where, &whichWindow );
switch ( thePart )
{
case inMenuBar:
menuChoice = MenuSelect( gTheEvent.where );
HandleMenuChoice( menuChoice );
break;
case inSysWindow:
SystemClick( &gTheEvent, whichWindow );
break;
case inDrag:
DragWindow( whichWindow, gTheEvent.where, &gDragRect );
SetPort( whichWindow );
break;
case inGoAway:
HideWindow( whichWindow );
break;
case inContent:
SelectWindow( whichWindow );
break;
case inGrow:
break;
}
}
HandleMenuChoice( menuChoice )
long int menuChoice;
{
int theMenu;
int theItem;
if ( menuChoice != 0 )
{
theMenu = HiWord( menuChoice );
theItem = LoWord( menuChoice );
switch ( theMenu )
{
case APPLE_MENU_ID:
HandleAppleChoice( theItem );
break;
case FILE_MENU_ID:
HandleFileChoice( theItem );
break;
}
HiliteMenu( 0 );
}
}
HandleAppleChoice( theItem )
int theItem;
{
Str255 accName;
int accNumber;
short int itemNumber;
switch ( theItem )
{
case ABOUT_ITEM:
NoteAlert( ABOUT_ALERT, NIL_POINTER );
break;
default:
GetItem( gAppleMenu, theItem, accName );
accNumber = OpenDeskAcc( accName );
break;
}
}
HandleFileChoice( theItem )
int theItem;
{
switch( theItem )
{
case SHOW_ALL_WINDOW_ITEM:
ShowWindow( gCellWindow );
ShowWindow( gCellInfoDialog );
DrawDialog( gCellInfoDialog );
SelectWindow( gCellInfoDialog );
break;
case QUIT_ITEM:
gDone = TRUE;
break;
}
}
ResizeWindow( whichWindow, windSize )
long windSize;
WindowPtr whichWindow;
{
GrafPtr oldPort;
GetPort( &oldPort );
SetPort( whichWindow );
SizeWindow( whichWindow, 170, HiWord( windSize ), NORMAL_UPDATES );
SetPort( oldPort );
}